# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=svt-vp9
pkgver=0.2.2
pkgrel=0
pkgdesc="Scalable Vector Technology for VP9 encoder (SVT-VP9 Encoder)"
url="https://01.org/svt"
arch="x86_64" #x86: error: incompatible type for argument 2 of '_mm_storel_epi64'
license="BSD-2-Clause-Patent"
options="!check" # No test suite from upstream
makedepends="cmake yasm"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVisualCloud/SVT-VP9/archive/v$pkgver.tar.gz"
builddir="$srcdir/SVT-VP9-$pkgver"

build() {
	mkdir -p build

	cd build

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS"

	make
}

package() {
	cd build

	make DESTDIR="$pkgdir" install

	cd "$builddir"

	install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="0964ae11631c0c0a106413aa5ac9f89d2d032f732810ab6b3fbb91457d4d6e74a00d1fad444921ce0a704256fb224a43effe16eae838ccd7af93df37b1b0d7f4  svt-vp9-0.2.2.tar.gz"
